//
//  ViewController.m
//  TestDemoInfo
//
//  Created by  Mac on 2021/1/8.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    UIButton * button = [UIButton buttonWithType:(UIButtonTypeCustom)];
    button.frame = CGRectMake(10, 65, 120, 40);
    //    button.backgroundColor = [UIColor whiteColor];
    button.layer.borderWidth = 1;
    button.layer.masksToBounds = YES;
    button.layer.borderColor = [UIColor blueColor].CGColor;
    
    button.layer.cornerRadius = 5;
    [button setTitle:@"点  击" forState:(UIControlStateNormal)];
    [button setTitleColor:[UIColor blueColor] forState:(UIControlStateNormal)];
    [button addTarget:self action:@selector(clickBtnFunction) forControlEvents:(UIControlEventTouchUpInside)];
    [button setTitleColor:[UIColor lightGrayColor] forState:(UIControlStateHighlighted)];
    [self.view addSubview:button];
    


}
-(void)clickBtnFunction {
    NSLog(@"点击了按钮");
    UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"注册新用户" message:nil preferredStyle:UIAlertControllerStyleAlert];
    
    [alert addAction:[UIAlertAction actionWithTitle:@"收藏" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        
    }]];
    
    [self presentViewController:alert animated:YES completion:nil];
}


@end
